using System;
using SharpMud.MudLib.SAMPLE;
using SharpMud.MudLib.SAMPLE.Entities;
using SharpMud.MudLib.SAMPLE.Environment;
#if Use_Common_MudLib
using SharpMud.MudLib.Common.Environment;
using SharpMud.MudLib.Common.Environment.Persistance;
#endif

namespace SharpMud.MudLib.SAMPLE.Environment
{
	/// <summary>
	/// Represents the means for a character to move from one room to another
	/// </summary>
	public interface IExit : IDisposable
	{
		/// <summary>
		/// The room that this IExit points to
		/// </summary>
#if !Use_Common_MudLib
		RoomID		
#else
        RoomReference
#endif
                                    TargetRoom			{get;}

		/// <summary>
		/// The static phrases that the player must enter (one of) at a command prompt
		/// to trigger this exit. It is up to an external (to this exit) command parser
		/// to match one of these triggers and attempt the use of this exit.
		/// </summary>
		string[]	UsageKeyphrases		{get;}

		/// <summary>
		/// Determines if the exit would let the given character use it. This is a soft hit,
		/// </summary>
		/// <remarks>
		/// Something such as a door or gate or portal may take into affect
		/// whether or not it is 'open', or 'locked', etc
		/// </remarks>
		bool		IsImmediatelyUsableTo(ICharacter actor);

		/// <summary>
		/// Attempt to use this exit by the given character.
		/// Is responsible for messaging the character on success/failure, is responsible for messaging
		/// involved rooms on the departure/arrival, etc.
		/// </summary>
		/// <param name="actor">The poor schmuck that is trying to use the exit</param>
		/// <returns>Returns true if the usage attempt succeeded, otherwise false.</returns>
		bool		AttemptUsageBy(ICharacter actor);
	}

	public interface IDescribableExit : IExit, IDescribable
	{
		/// <summary>
		/// Determines if the exit is obvious to the given character
		/// </summary>
		bool		IsObviousTo(ICharacter actor);

		/// <summary>
		/// Determines if the exit is self-describing (when returning 'true'), or target-describing
		/// (when returning 'false')
		/// </summary>
		bool		IsObtrusiveTo(ICharacter actor);
	}
}
